package top.sdwu_top.kbase.entity;

import org.springframework.security.core.GrantedAuthority;
import top.sdwu_top.kbase.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 角色
 * </p>
 *
 * @author zhipeng.duan@nvr-china.com
 * @since 2020-02-20
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="KbaseAuthRole对象", description="角色")
public class KbaseAuthRole extends BaseEntity implements GrantedAuthority {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "角色名")
    @TableField("ROLE_NAME")
    private String roleName;

    @ApiModelProperty(value = "父级ID")
    @TableField("PARENT_ID")
    private String parentId;

    @ApiModelProperty(value = "状态")
    @TableField("STATE")
    private String state;


    @Override
    public String getAuthority() {
        return this.getId();
    }
}
